<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
<title>打开新文档并输出内容</title>
<script type="text/javascript">
	function oc(){
		var dw;
		dw=window.open();
		dw.document.open();
		dw.document.write("<html><head><title>一个新的文档</title></head>");
		dw.document.write("<body>");
		dw.document.write("<img src='1.jpg'><br>")
		dw.document.write("这里是写入的新内容<br>");
		dw.document.write("</body></html>");
		dw.document.close();
	}
</script>
</head>
<body>
<input type="button" value="打开一个新文档" onclick="oc();"/>
</body>
</html>
